window.addEventListener("load",function () {
    let Times = document.querySelector("#Times");
    times();
    setInterval(times, 1000);
    function times() {
        let nowday = new Date();
        let future = new Date("2021-10-1 00:00:00");
        //差
        let bad = future - nowday;
        //天
        let day = Math.floor(bad/1000/60/60/24);
        //时
        let hours = Math.floor(bad/1000/60/60%60);
        //分
        let minute = Math.floor(bad/1000/60%60);
        //秒
        let second = Math.floor(bad/1000%60);
        //倒计时渲染
        Times.textContent = `${day}:${hours}:${minute}:${second}`;
    }
});
